//
//  ActivityCollectViewController.m
//  DoubanDemo1
//
//  Created by lanou3g on 15/11/21.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "ActivityCollectViewController.h"
#import "ActivityCollectView.h"
#import "MovieDetail.h"
#import "MovieDetailViewController.h"
@interface ActivityCollectViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic,strong)ActivityCollectView *activityCollectView;


@end

@implementation ActivityCollectViewController

- (void)loadView
{
    self.activityCollectView = [[ActivityCollectView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.view = self.activityCollectView;
//    self.title = @"活动收藏";
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.activityCollectView.tableView.dataSource = self;
    self.activityCollectView.tableView.delegate = self;
    // Do any additional setup after loading the view.
    
    
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    NSLog(@"%@",self.array);
    return self.array.count;
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cell_id = @"cell_id";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cell_id];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cell_id];
    }
    cell.textLabel.text = [self.array[indexPath.row] movieName];
    
    
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    MovieDetailViewController *movieDetailVC = [[MovieDetailViewController alloc] init];
    movieDetailVC.movieDetail = self.array[indexPath.row];
    movieDetailVC.title = [self.array[indexPath.row] movieName];
    [self.navigationController pushViewController:movieDetailVC animated:YES];
    
    
}


















- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
